﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;

namespace IDE_week2_Forms_project
{
    public partial class Form_IDE_week_2 : Form
    {
        public string lang = "en";
        
        public Form_IDE_week_2()
        {
            InitializeComponent();
        }

        private void button_Open_new_form_Click(object sender, EventArgs e)
        {
            var Form2 = new Form2();
            Form2.Show();
        }

        private void button_Change_icon_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Icon1;
        }

        private void button_Reset_icon_Click(object sender, EventArgs e)
        {
            this.Icon = null;
        }

        private void button_Change_language_Click(object sender, EventArgs e)
        {
            if (this.lang == "en")
            {
                this.lang = "de";
            }

            else if (this.lang == "de")
            {
                this.lang = "nl";
            }

            else if (this.lang == "nl")
            {
                this.lang = "en";
            }

            this.ChangeLanguage(lang);
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form_IDE_week_2));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void button_Call_Class_1_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];
        }
    }
}
